package com.example.qihuibao.widget.dialog

import android.widget.Button
import android.widget.EditText
import android.widget.TextView
import com.example.qihuibao.R
import com.example.qihuibao.base.BaseDialogFragment

/**
 *@author: cww
 *@desc:
 *@date: 5/16/23 10:58 AM
 */
class YesOrNoDialog(private val title:String, private val message:String, val click:(ok:Boolean)->Unit) : BaseDialogFragment(R.layout.dialog_yes_or_no) {

    override fun initView() {
        mView?.findViewById<TextView>(R.id.tv_title)?.text = title
        mView?.findViewById<TextView>(R.id.tv_message)?.text = message
        mView?.findViewById<Button>(R.id.btn_cancel)?.setOnClickListener {
            dismiss()
            click(false)
        }
        mView?.findViewById<Button>(R.id.btn_ok)?.setOnClickListener {
            dismiss()
            click(true)
        }
    }

}